use Bio::Tools::Mlst;
use Bio::Perl;
my $adk_4=Bio::Seq->new(
  -seq=>'GAAGCGAAAAAAATCATTGACGAAGGCGGCTTGGTGCGCGACGACATCATTATCGGCATGGTCAAAGAACGCATCGCGCAAGACGACTGCAAAAACGGTTTCCTGTTCGACGGTTTCCCGCGCACATTGGCACAAGCCGAAGCGATGGTTGAAGCAGGCGTGGATTTGGATGCAGTCGTTGAAATCGATGTGCCTGACAGCGTGATTGTCGATCGTATGAGCGGCCGCCGCGTGCATTTGGCTTCCGGCCGTACTTACCACGTTACCTACAACCCGCCCAAAGTTGAAGGCAAAGACGACGTAACCGGCGAAGATTTGATTCAGCGCGACGACGACAAAGAAGAAACCGTGAAAAAACGCCTTGCCGTTTACCACGAGCAAACCGAAGTTTTGGTCGATTTTTACAGCAAACTGGAAGGCGAACACGCGCCTAAATACATCAAAGTTGACGGCACTCAGCCGGTA', # adk_-4
  -id=>"adk_4",
);
my $locus="adk_";

$pubmlst=Bio::Tools::Mlst->new({database=>"neisseria",locus=>$locus});

print "BLAST against only adk_.\n";
$blastresult=$pubmlst->locusBlast({seq=>$adk_4,locus=>$locus,numresults=>3});
while( my $result = $blastresult->next_result ) {
  ## $result is a Bio::Search::Result::ResultI compliant object
  while( my $hit = $result->next_hit ) {
    ## $hit is a Bio::Search::Hit::HitI compliant object
    while( my $hsp = $hit->next_hsp ) {
      ## $hsp is a Bio::Search::HSP::HSPI compliant object
          print "Query=",   $result->query_name,
            " Hit=",        $hit->name,
            " Length=",     $hsp->length('total'),
            " Percent_id=", $hsp->percent_identity, "\n";
    }  
  }
}

print "BLAST against all loci.\n";
$in=$pubmlst->blast({seq=>$adk_4,numresults=>3});
while( my $result = $in->next_result ) {
  ## $result is a Bio::Search::Result::ResultI compliant object
  while( my $hit = $result->next_hit ) {
    ## $hit is a Bio::Search::Hit::HitI compliant object
    while( my $hsp = $hit->next_hsp ) {
      ## $hsp is a Bio::Search::HSP::HSPI compliant object
      if( $hsp->length('total') > 50 ) {
        if ( $hsp->percent_identity >= 75 ) {
          print "Query=",   $result->query_name,
            " Hit=",        $hit->name,
            " Length=",     $hsp->length('total'),
            " Percent_id=", $hsp->percent_identity, "\n";
        }
      }
    }  
  }
}